package com.qili.mapper.exam;

import com.qili.base.mapper.BaseMapper;
import com.qili.entity.exam.ExPaper;
import com.qili.entity.exam.ExQuestion;
import com.qili.entity.exam.ExTree;
import com.qili.entity.exam.dto.ExPaperDTO;
import com.qili.entity.exam.dto.ExQuestionDTO;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author zhangxiaopeng
 * @date 2021-05-08
 */
public interface ExPaperMapper extends BaseMapper<ExPaper,String> {

    List<ExTree> selectTree(ExTree tree);
    List<ExTree> selectTrees(ExTree tree);
    int updateTree(Map map);

    List<ExQuestion> stList(String str);

    List<ExQuestion> stListByType(ExQuestionDTO exQuestionDTO);

    List<String> insertPaperSj(ExPaperDTO exPaperDTO);
    List<Map<String,Object>> selectRandomSt(ExPaperDTO exPaperDTO);

    /**
     * @param map
     * @Description:查询考试用的试卷
     * @Date:13:28 2021-08-19
     */
    List<ExPaper> selectExPaper(Map map);


    List<ExPaper> selectExPaperList(ExPaperDTO dto);

    List<ExPaper> selectRecycle(ExPaper dto);

    int deleteSjs(Map map);

    Integer refreshTotalScore(String paperId);

    int updateBatchPaperStatus(String[] ids);

    int deleteSt(Map map);

    int insertTree(Map map);

    Integer refreshTotalNum(String paperId);

    Map<String, Object> selectPaperQuCountById(String paperId);

    Integer selectQuestionSjCanUse(ExQuestion exQuestion,String[] quIds);

    int delFormRecycle(String paperId);

    int deleteFromRecycle(String[] ids);

    int hyAll(String[] ids);

    /**
     * 递归查出试题分类数据-【2021年11月15日13:29:50】
     * @param id
     * @param groupid
     * @return
     */
    List<ExTree> selectSubordinateTrees(@Param("id") String id,@Param("groupid") String groupid);

    /**
     * 批量删除
     * @param map
     */
    void deleteSjsN(Map<String, Object> map);

    void hyAllN(@Param("id") String id,@Param("type") String type);

    List<ExTree> selectTreesByType(@Param("tree") ExTree tree, @Param("type") String type);
}
